﻿<!DOCTYPE html>
<html>
<head>
    <title>完善个人信息</title>
</head>
<body>
    <div>
        <section data-role="page" id="personalinfo_main">
            <div data-role="content" id="personalinfo_content">
                <fieldset data-role="controlgroup">
                    <legend>
                        <img src="images/MemInformation.png" alt="" />
	               	    完善会员卡资料
                    </legend>
                    <label for="memname">姓名</label>
                    <input type="text" id="memname" placeholder="请输入您的姓名" runat="server"/>
                    <label for="memgender">性别</label>
                    <select id="memgender" data-role="slider" runat="server">
                        <option value="1">男</option>
                        <option value="0">女</option>
                    </select>
                    <label for="membirthday">出生日期</label>
                    <input type="text" placeholder="请选择您的出生日期" id="membirthday" readonly runat="server" />
                    <label for="telnumber">手机号码</label>
                    <input type="text" id="telnumber" placeholder="请输入您的手机号码" runat="server" />
                    <label for="mail">电子邮箱</label>
                    <input type="text" id="mail" placeholder="请输入您的电子邮箱" runat="server" />
                    <label for="address">联系地址</label>
                    <textarea id="address" placeholder="请输入您的联系地址"   runat="server" style="height:100px;"></textarea>
                    <a href="#" data-role="button" data-theme="b" id="personalinfoSumbit">确认修改</a>
                    <a href="#index" data-role="button" data-theme="b" style="display:none;" id="goBack">返回首页</a>
                </fieldset>
            </div>
            <script type="text/javascript">
                $(document).ready(function (e) {
                    var opt1 = {
                        preset: 'date', //日期
                        theme: 'jqm', //皮肤样式
                        display: 'modal', //显示方式 
                        mode: 'scroller', //日期选择模式
                        dateFormat: 'yy-mm-dd', // 日期格式
                        setText: '确定', //确认按钮名称
                        cancelText: '取消', //取消按钮名籍我
                        dateOrder: 'yymmdd', //面板中日期排列格式
                        dayText: '日', monthText: '月', yearText: '年', //面板中年月日文字
                        endYear: 2020 //结束年份
                    };
                    $("#membirthday").mobiscroll(opt1).date(opt1);
                });

                $("#personalinfoSumbit").click(function () {
                    var memname = $.trim($("#memname").val());
                    var memgender = $.trim($("#memgender").val());
                    var membirthday = $.trim($("#membirthday").val());
                    var telnumber = $.trim($("#telnumber").val());
                    var mail = $.trim($("#mail").val());
                    var address = $.trim($("#address").val());
                    if (telnumber != "" && !telnumber.IsMobile()) {
                        alert("您输入的手机号码格式有误");
                        return;
                    }
                    if (mail != "" && !mail.IsEmail()) {
                        alert("您输入的电子邮箱格式有误");
                        return;
                    }
                    $.get("../Service/AjaxService.ashx?Method=UpdateMemInfo",
                    {
                        "MemName": memname,
                        "MemSex": memgender,
                        "MemBirthday": membirthday,
                        "MemMobile": telnumber,
                        "MemEmail": mail,
                        "MemAddress": address,
                        "MemID": getCookie("uid")
                    }
                    , function (text) {
                        if (text == "0") { alert("系统有点繁忙，提交失败！"); } else { alert("提交成功"); }
                        $("#goBack").click();
                    }, "text")
                })
            </script>
            <footer data-role="footer" data-position="fixed" id="personalinfo_footer">
                <div data-role="navbar" id="nav-glyphish-example">
                    <ul>
                        <li><a href="#index" data-icon="custom" id="site">商家网站</a></li>
                        <li><a href="#goodlist" data-load="goodlist.aspx" data-icon="custom" id="buy">商品购买</a></li>
                        <li><a href="#membershipcard" data-load="membershipcard.aspx" data-icon="custom"  id="card" class="ui-btn-active">会员卡</a></li>
                        <li><a href="#giftlist" data-load="giftlist.aspx" data-icon="custom" id="convert">积分兑换</a></li>
                    </ul>
                </div>
            </footer>
        </section>
    </div>
</body>
</html>

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="personalinfo.aspx.cs" Inherits="personalinfo"
    EnableViewState="false" %>

